package com.kingsoft.dc.khaos.extender.meta.impl;

import com.alibaba.fastjson.JSON;
import com.kingsoft.dc.khaos.extender.meta.model.ds.Connect;
import com.kingsoft.dc.khaos.extender.meta.model.ds.HbaseConnect;

import java.util.Map;

/**
 * Created by haorenhui on 2019/06/28.
 */
public class HbaseDmMetaImpl extends DmMetaImpl{
    @Override
    public Connect decryptDatasourceConnectSecret(String config) {
        HbaseConnect connect = JSON.parseObject(config, HbaseConnect.class);
        Map<String,String> map = (Map<String,String>) JSON.parse(config);
        String zookeeper_znode_parent = map.get("zookeeper.znode.parent");
        connect.setZookeeperZnodeParent(zookeeper_znode_parent);
        return connect;
    }
}
